<?php
$bottom_margin = $_MODULE[bottom_margin];
$bottom_color = $_MODULE[bottom_color];
if (!isset($bottom_margin)) $bottom_margin = 0;
if (!isset($bottom_color)) $bottom_color = "#FFFFFF";

function getParam($paramName, $defaultValue = '')
{
    global $_MODULE;
    $value = $_MODULE[$paramName];
    if (empty($value)) return $defaultValue;
    return $value;
}

function myEcho($paramName,$defaultValue){
    echo getParam($paramName,$defaultValue);
}

function echoHref($paramName){
    $val = getParam($paramName,null);
    if(empty($val)) {
        echo '';
        return;
    };
    echo " href='$val' ";
}

function echoTitleColor($paramName){
    echo getParam($paramName,'#CDAA7D');
}

function echoMainTitle($paramName){
    echo getParam($paramName,'主标题1');
}

function echoSubTitle($paramName){
    echo getParam($paramName,'副标题1');
}

function echoIsShow($paramName){
    $param =  getParam($paramName,null);
    if(empty($param)){
        echo 'noShow';
        return ;
    }
    echo '';
}

?>

<div class='module dshop-um-ggw2 module-thirdparty'
     style='margin-bottom:<? echo $bottom_margin; ?>px; background-color:<? echo $bottom_color; ?>;'>
    <table>
        <tr>
            <td rowspan='2' style='padding-right: 15px;'>
                <a  <?php echoHref('left_link')?>  target='_blank' class='no_decoration'>
                    <div class='positive_bg_img_left'
                         style='background-image:url(<? myEcho('left_image_1', 'assets/images/left_1.jpg') ?>);'>
                        <div class='title'>
                            <p class='main_title'
                               style='color: <? echoTitleColor('left_main_title_color') ?>'><? echoMainTitle('left_main_title') ?></p>
                            <p class='sub_title'
                               style='color: <? echoTitleColor('left_sub_title_color') ?>'><? echoSubTitle('left_sub_title') ?></p>
                        </div>
                        <div class='reverse_bg_img_left <? echoIsShow('left_image_0')?>'
                             style='background-image:url(<? myEcho('left_image_0', 'assets/images/left_0.jpg') ?>)'>
                            <div class='title'>
                                <p class='main_title'
                                   style='color: <? echoTitleColor('left_main_title_color') ?>'><? echoMainTitle('left_main_title') ?></p>
                                <p class='sub_title'
                                   style='color: <? echoTitleColor('left_sub_title_color') ?>'><? echoSubTitle('left_sub_title') ?></p>
                            </div>
                        </div>
                    </div>
                </a>
            </td>
            <td style='padding-bottom: 15px;padding-right: 15px;'>
                <a  <?php echoHref('right_one_link')?>  target='_blank' class='no_decoration'>
                    <div class='positive_bg_img'
                         style='background-image:url(<? myEcho('right_one_image_1', 'assets/images/right_one_1.jpg') ?>);'>
                        <div class='title'>
                            <p class='main_title'
                               style='color: <? echoTitleColor('right_one_main_title_color') ?>'><? echoMainTitle('right_one_main_title') ?></p>
                            <p class='sub_title'
                               style='color: <? echoTitleColor('right_one_sub_title_color') ?>'><? echoSubTitle('right_one_sub_title') ?></p>
                        </div>
                        <div class='reverse_bg_img  <? echoIsShow('right_one_image_0')?>'
                             style='background-image:url(<? myEcho('right_one_image_0', 'assets/images/right_one_0.png') ?>);'>
                            <div class='title'>
                                <p class='main_title'
                                   style='color: <? echoTitleColor('right_one_main_title_color') ?>'><? echoMainTitle('right_one_main_title') ?></p>
                                <p class='sub_title'
                                   style='color: <? echoTitleColor('right_one_sub_title_color') ?>'><? echoSubTitle('right_one_sub_title') ?></p>
                            </div>
                        </div>
                    </div>
                </a>
            </td>
            <td style='padding-bottom: 15px;'>
                <a  <?php echoHref('right_two_link')?>  target='_blank' class='no_decoration'>
                    <div class='positive_bg_img'
                         style='background-image:url(<? myEcho('right_two_image_1', 'assets/images/right_two_1.jpg') ?>);'>
                        <div class='title'>
                            <p class='main_title'
                               style='color: <? echoTitleColor('right_two_main_title_color') ?>'><? echoMainTitle('right_two_main_title') ?></p>
                            <p class='sub_title'
                               style='color: <? echoTitleColor('right_two_sub_title_color') ?>'><? echoSubTitle('right_two_sub_title') ?></p>
                        </div>
                        <div class='reverse_bg_img   <? echoIsShow('right_two_image_0')?>'
                             style='background-image:url(<? myEcho('right_two_image_0', 'assets/images/right_two_0.png') ?>);'>
                            <div class='title'>
                                <p class='main_title'
                                   style='color: <? echoTitleColor('right_two_main_title_color') ?>'><? echoMainTitle('right_two_main_title') ?></p>
                                <p class='sub_title'
                                   style='color: <? echoTitleColor('right_two_sub_title_color') ?>'><? echoSubTitle('right_two_sub_title') ?></p>
                            </div>
                        </div>
                    </div>
                </a>
            </td>
        </tr>
        <tr>
            <td colspan='2'>
                <a  <?php echoHref('down_link')?>  target='_blank' class='no_decoration'>
                    <div class='positive_bg_img_bottom'
                         style='background-image:url(<? myEcho('down_image_1', 'assets/images/down_1.jpg') ?>);'>
                        <div class='title'>
                            <p class='main_title'
                               style='color: <? echoTitleColor('down_main_title_color') ?>'><? echoMainTitle('down_main_title') ?></p>
                            <p class='sub_title'
                               style='color: <? echoTitleColor('down_sub_title_color') ?>'><? echoSubTitle('down_sub_title') ?></p>
                        </div>
                        <div class='reverse_bg_img_bottom   <? echoIsShow('down_image_0')?>'
                             style='background-image:url(<? myEcho('down_image_0', 'assets/images/down_0.jpg') ?>);'>
                            <div class='title'>
                                <p class='main_title'
                                   style='color: <? echoTitleColor('down_main_title_color') ?>'><? echoMainTitle('down_main_title') ?></p>
                                <p class='sub_title'
                                   style='color: <? echoTitleColor('down_sub_title_color') ?>'><? echoSubTitle('down_sub_title') ?></p>
                            </div>
                        </div>
                    </div>
                </a>
            </td>
        </tr>
    </table>
</div>
